﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Globalization;
using Domain;
using WindowsFormsApplication1.ServiceReference;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private ServiceClient serviceClient = new ServiceClient(); 

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
                       
            List<User> userList = serviceClient.ListAllUsers(); 
            this.dataGridView1.DataSource = userList;
        }

        private void button2_Click(object sender, EventArgs e)
        {
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            List<Language> languageQuery = serviceClient.ListAvailableLanguages();
            List<string> languageList = new List<string>();
            foreach (Language l in languageQuery)
                languageList.Add(l.Name + " (" + l.TwoLetterISOName + ")");
            cbxNativeLanguage.DataSource = languageList;
            cbxLanguageToLearn.DataSource = languageList;
 
        }
    }
}
